/*************************************************************************
    > File Name: face_detect_task.h
    > Author: fanzhihui
    > Mail: 953106194@qq.com 
    > Created Time: 2019年06月28日 星期五 11时02分54秒
 ************************************************************************/
#ifndef _FTRACK_FACE_DETECT_TASK_H_
#define _FTRACK_FACE_DETECT_TASK_H_
#include "thread/task.h"
#include<iostream>
#include <vector>
#include <string>
#include "thread/tssproxy.h"
#include "redis/redis.h"
#include "tracked_face_info.h"

using namespace std;
using namespace thread;


class FaceDetectTask : public Task
{
	typedef struct search_return_{
		string img_name;
		string face_id;
		string face_key;
		float score;
	}search_return_t;

public:
	FaceDetectTask(const string& src,const vector<tracked_face_t>& faces):
		src_img(src),
		tracked_faces(faces)

	{
	
	}
	
	void Execute(TaskThread* thread_context,void *app_context);
	
	void Release(){
		delete this;
	}

private:
	string packReqBody();
	void unPackResBody(const string& body,map<string,search_return_t>& searched);


private:
	string src_img;
	vector<tracked_face_t> tracked_faces;

};


#endif


